<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div class="box"></div>
    <script>
        let box = document.querySelector(".box")
        //onclick  点击事件  按下和抬起

        //onmousedown   鼠标按下
        box.onmousedown = function(){
            console.log("按下");
            

        }

        //onmouseup  鼠标抬起
        box.onmouseup = function(){
            console.log("抬起");
            
        }

        box.oncontextmenu = function(e){
            e.preventDefault()
            console.log(123123);
            
        }

        box.onmouseenter = function(){
            console.log("鼠标移入");
            
        }
        box.onmouseleaver = function(){
            console.log("鼠标移出");
            
        }
        box.onmousemove = function(){
            console.log("鼠标移动");
            
        }




    </script>
    
</body>
</html>